home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / pxewin.zip / PXEOBJ.CPP < prev    next >
Text File  |  1992-02-06  |  3KB  |  124 lines

  1. // PXEWIN - (C) Copyright 1992 by Beam Engineering, INC.
  2.  
  3. // PXEOBJ.CPP //
  4.  
  5. // Contents ----------------------------------------------------------------
  6. //
  7. //    This module contains class members for the PXEngObject class.
  8. //
  9. // End ---------------------------------------------------------------------
  10.  
  11. // External Reference Name For This Header ---------------------------------
  12.  
  13. #ifndef PXEOBJ_CPP
  14.     #define PXEOBJ_CPP
  15.  
  16. // End ---------------------------------------------------------------------
  17.  
  18. // Interface Dependencies --------------------------------------------------
  19.  
  20. #ifndef PXEOBJ_HPP
  21.     #include "pxeobj.hpp"
  22. #endif // PXEOBJ_HPP //
  23.  
  24. // End ---------------------------------------------------------------------
  25.  
  26. // Constructor PXEngObject //
  27.  
  28. inline PXEngObject::PXEngObject()
  29. {
  30.     close_status = CLOSED;
  31. }
  32.  
  33. // Description -------------------------------------------------------------
  34. //
  35. //    Initialize error status to no errors.
  36. //
  37. // End ---------------------------------------------------------------------
  38.  
  39. // member PXError of PXEngObject //
  40.  
  41. void PXEngObject::PXError(int org)
  42. {
  43.     // Copy origin ot Error data
  44.  
  45.     EngDataPtr->Errors.Origin = org;
  46.  
  47.     // Switch in correct member for return string
  48.  
  49.     switch(EngDataPtr->Errors.Origin)
  50.     {
  51.         case ENG_ERROR:
  52.         {
  53.             EngDataPtr->Errors.EngMem = &PXEngObject::RetPXMsg;
  54.             break;
  55.         }
  56.         case EWIN_ERROR:
  57.         {
  58.             EngDataPtr->Errors.EngMem =
  59.                 &PXEngObject::RetPXEWINErrorMsg;
  60.             break;
  61.         }
  62.     }
  63. }
  64.  
  65. // Summary -----------------------------------------------------------------
  66. //
  67. //    This member will switch in the correct return error string function
  68. //    depending on the origin of the error.
  69. //
  70. // End ---------------------------------------------------------------------
  71.  
  72. // member build of PXEngObject //
  73.  
  74. PTStreamable PXEngObject::build()
  75. {
  76.     return new PXEngObject(streamableInit);
  77. }
  78.  
  79. TStreamableClass RegPXEngObject("PXEngObject",PXEngObject::build,
  80.     __DELTA(PXEngObject));
  81.  
  82. // Description -------------------------------------------------------------
  83. //
  84. //    When the streamable constructor is called, TStreamable dispatches
  85. //    the build member to construct the object.  To do this, it must
  86. //    know where to find this member functions for the specific class.
  87. //    This is the reason for the stream registration.
  88. //
  89. // End ---------------------------------------------------------------------
  90.  
  91. // member read of PXEngObject //
  92.  
  93. inline Pvoid PXEngObject::read(Ripstream)
  94. {
  95.     close_status = CLOSED;
  96.     return this;
  97. }
  98.  
  99. // Description -------------------------------------------------------------
  100. //
  101. //    Since read is called after the streamable constructor is called, you
  102. //    need to set the PXEngObject to it's default state with no errors.
  103. //    Nothing is taken off the stream.  You could have put this with the
  104. //    streamable constructor but by convension I have put it here.
  105. //
  106. // End ---------------------------------------------------------------------
  107.  
  108. // member write of PXEngObject //
  109.  
  110. inline void PXEngObject::write(Ropstream)
  111. {
  112.  
  113. }
  114.  
  115. // Description -------------------------------------------------------------
  116. //
  117. //    Nothing is streamed here.  This is here only to make an instance of
  118. //    this class.
  119. //
  120. // End ---------------------------------------------------------------------
  121.  
  122. #endif // PXEOBJ_CPP //
  123.  
  124.